package com.woniuxy.controller;


import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.netflix.discovery.converters.Auto;
import com.woniuxy.ResponseResult;
import com.woniuxy.service.StoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2021-03-23
 */
@RestController
@RequestMapping("/store/")
@Slf4j
public class StoreController {
    @Autowired
    private StoreService storeService;
    @GetMapping("getStoreById")
    public ResponseResult<Map<String, Object>> getStoreById(Integer storeId){
        ResponseResult<Map<String, Object>> responseResult = storeService.getStoreById(storeId);
        return responseResult;
    }
    @GetMapping("getStoreByIds")
    public ResponseResult<List<Map<String, Object>>> getStoreByIds(Integer[] ids ) {
          log.info("value="+ids[0]);
        ResponseResult<List<Map<String, Object>>> result = storeService.getStoreByIds(Arrays.asList(ids));
        return result;
    }

}

